package org.feiye.studyday07;

import java.util.Scanner;

public class StudyDaySeven {

	public static void main(String[] args) {
		// 声明数组长度
		int[] scores = new int[5];
		double sum = 0;
		double avg = 0;
		Scanner sc = new Scanner(System.in);
		for (int i = 0; i < scores.length; i++) {
		System.out.println("输入第" + (i + 1) + "名同学成绩：");
		// 赋值
		scores[i] = sc.nextInt();
			sum += scores[i];
		}
		avg = sum / 5;
		System.out.println(avg);
//		double sum = 0;
//		double avg = 0;
//		for (int i = 0; i < 5; i++) {
//			System.out.println("输入" + (i + 1) + "名学生的成绩：");
//			int grade = sc.nextInt();
//			sum += i;
//		}
//		avg = sum / 5;
//		System.out.println(avg);
	}
}
